import sqlite3


def get_connection_sql_lite(db_path: str):
    # 创建数据库连接
    return sqlite3.connect(db_path)


def exec_sql_file(conn, filepath):
    with open(filepath, 'r', encoding='utf-8') as f:
        sql_script = f.read()
    conn.executescript(sql_script)


if __name__ == '__main__':
    lite_conn = get_connection_sql_lite("init.db")
    exec_sql_file(lite_conn, 'data/schema.sql')
    pass